﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MantClienteForm.aspx.cs" Inherits="Bastanteo.Paginas.MantClienteForm" %>
<%@ Register Src="../Controles/MenuPrincipal.ascx" TagName="MenuPrincipal" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Mantenimiento de Cliente</title>
    <link href="../Estilos/General.css" type="text/css" rel="stylesheet" />
    <LINK title="win2k-cold-1" media="all" href="../Estilos/calendar-blue.css" type="text/css" rel="stylesheet" />
    <script src="../Scripts/calendar/calendar.js" type="text/javascript"></script>
    <script src="../Scripts/calendar/calendar_es.js" type="text/javascript"></script>
    <script src="../Scripts/calendar/calendario_call.js" type="text/javascript"></script>
    <script src="../Scripts/calendar/calendar_setup.js" type="text/javascript"></script>
    <script src="../Scripts/funciones.js" type="text/javascript"></script>
    <script language="javascript">
        function Grabar() {
            if (document.frmMain.txtCodigo.value.length == 0) {
                document.frmMain.txtCodigo.value = "";
                document.frmMain.txtCodigo.focus();
                alert("Codigo de Cliente No Valido...!");
                return false;
            }
            document.frmMain.hidAccion.value = "G";
            document.frmMain.submit();
        }
        function validarNumero(numero) {
            if (!/^([0-9])*$/.test(numero)) {
                alert("El Codigo de Tienda " + numero + " es Invalido...!!!");
                return 0;
            } else {
                return 1;
            }
        }
        function Cancelar() {
            //alert("Desea Cancelar");
            //history.back(-1);
            history.go(-1);
        }
        function Buscar() {
            if (document.frmMain.txtDNI.value == "" && document.frmMain.txtFechaProgIni.value == "" &&
            document.frmMain.txtFechaProgFin.value == "" && document.frmMain.txtFechaExaIni.value == "" &&
            document.frmMain.txtFechaExaFin.value == "" && document.frmMain.DrpTienda.value == "0" &&
            document.frmMain.DrpEstado.value == "0") {
                alert("Ingrese Nª DNI o Rango de Fechas");
                return false;
            }

            if (document.frmMain.txtFechaProgIni.value.length != 0 || document.frmMain.txtFechaProgFin.value.length != 0)
                if ((document.frmMain.txtFechaProgIni.value.length + document.frmMain.txtFechaProgFin.value.length) != 20) {
                    alert("Rango de Fecha de Programación INVALIDO");
                    return false;
                }
            if (document.frmMain.txtFechaExaIni.value.length != 0 || document.frmMain.txtFechaExaFin.value.length != 0)
                if ((document.frmMain.txtFechaExaIni.value.length + document.frmMain.txtFechaExaFin.value.length) != 20) {
                    alert("Rango de Fecha de Examen INVALIDO");
                    return false;
                }

            document.frmMain.hidDNI.value = document.frmMain.txtDNI.value;
            document.frmMain.hidFecIniPrograma.value = document.frmMain.txtFechaProgIni.value;
            document.frmMain.hidFecFinPrograma.value = document.frmMain.txtFechaProgFin.value;
            document.frmMain.hidFecIniExamen.value = document.frmMain.txtFechaExaIni.value;
            document.frmMain.hidFecFinExamen.value = document.frmMain.txtFechaExaFin.value;
            document.frmMain.hidAccion.value = "B";
            document.frmMain.submit();
        }
    </script>
</head>
<body>
<form id="frmMain" runat="server" name="frmMain">
  <input type="hidden" id="hidAccion" name="hidAccion" value="" runat="server"/>
  <input type="hidden" id="hidMensaje" name="hidMensaje" value="" runat="server"/>      
<div>
    <uc1:MenuPrincipal ID="mnuPrincipal" runat="server" />
</div>
<table  border="0"  width="100%" >
      <tr>
        <td style="height: 5px"><div align="right"></div>          <div align="right"></div></td>
      </tr>
      <tr>
        <td><div align="right" class="instruccion" style="text-align: center">
            Clientes</div>          </td>
      </tr>
      <tr>
        <td align="center" ><div align="right"></div>
        </td>
      </tr>
      <tr>
        <td><div align="right"></div>          
            <div align="right" style="text-align: center">
            <br />
            <table width="900px" border="0" >
                <tr>
                    <td width="100" class="tdlabelForm" style="width: 100px; text-align: right;">
                        Codigo 
                        Cliente :
                    </td>
                    <td width="300" style="width: 300px; text-align: left;">
                        <asp:TextBox ID="txtCodigo" class="tdlabelForm"  runat="server" Width="80px" MaxLength="5" onkeydown="eventoSoloNumeros();"></asp:TextBox></td>
                    <td width="100" class="tdlabelForm" style="width: 130px; text-align: right;">
                        Razón Social : 
                    </td>
                    <td width="300" style="width: 300px">
                        <asp:TextBox ID="txtRazonSocial" class="tdlabelForm"  style="text-transform :uppercase"  runat="server" Width="98%" ></asp:TextBox></td>
                    <td width="100" style="width: 80px">
                    </td>
                </tr>
                <tr>
                    <td width="100" class="tdlabelForm" style="width: 100px; text-align: right;">
                        RUC :</td>
                    <td style="width: 300px; text-align: left;">
                        <asp:TextBox ID="txtRuc" class="tdlabelForm"  runat="server" style="text-transform :uppercase"  Width="40%" MaxLength="10"  ></asp:TextBox></td>
                    <td class="tdlabelForm" style="width: 120px; text-align: right;">
                        Inicio Operaciones :
                    </td>
                    <td width="300" style="width: 300px; text-align: left;">
                        <asp:TextBox ID="txtInicioOperaciones" class="tdlabelForm"  runat="server" style="text-transform :uppercase"  Width="40%" ></asp:TextBox></td>
                    <td style="width: 80px">
                  <input name="BtnBuscar" id="BtnBuscar" type="button" runat="server"  class="btnout" onclick="return Grabar();"
                            value="Grabar" /></td>
                </tr>
                <tr>
                    <td width="100" class="tdlabelForm" style="width: 100px; text-align: right;">
                        Tipo Empresa :</td>
                    <td style="width: 300px; text-align: left;">
                        <asp:DropDownList ID="ddlTipoServicio" runat="server" Width="100px" CssClass="textForm"></asp:DropDownList>
                    </td>
                    <td class="tdlabelForm" style="width: 120px; text-align: right;">
                        Cant. empleados : 
                    </td>
                    <td width="300" style="width: 300px; text-align: left;">
                        <asp:TextBox ID="txtEmailGT" class="tdlabelForm"  runat="server" style="text-transform :uppercase"  Width="98%" ></asp:TextBox></td>
                    <td style="width: 80px" >
                    <input name="btnCancelar" id="btnCancelar" type="button" runat="server" onclick="Javascrip:history.back(-1)" class="btnout" value="Cancelar"/></td>
                </tr>
            </table>
        </div></td>
      </tr>
      <tr>
        <td class="titulon" valign="middle" >
            <div align="center">
                &nbsp;</div></td>
      </tr>
</table>
<p><br/>
</p>
</form>
    <script language="javascript">
        if (document.frmMain.hidMensaje.value != '') {
            alert(document.frmMain.hidMensaje.value);
            document.frmMain.hidMensaje.value = "";
        }   
   </script>
</body>

</html>
